Skip to main content

wildcard pattern

Type

glossary

Description

A string which describes a pattern to match using the wildcard format.

A wildcard pattern consists of a string of characters to match, which may be combined with any number of the following special character sequences:

  • * : Matches zero or more of any character. The filterPattern A*C
    matches \"AC\", \"ABC\", or \"ADZXC\".
- `?` : Matches exactly one character. The filterPattern `A?C` matches
\"ABC\", but not \"AC\" or \"ADZXC\".
- `[chars]` : Matches any one of the characters inside the brackets. The
filterPattern `A[BC]D` matches \"ABD\" or \"ACD\", but not \"AD\" or \"ABCD\".
- `[!chars]` : Matches any character which is not one of the characters
inside the brackets.
- `[char-char]` : Matches any character whose unicode codepoint is between
the first character and the second character, such as `[a-y]` any character
between \"a\" and \"y\" but not \"z\"

You can match instances of special chars as follows:

  • ? with [?]
  • * with [*]
  • [ with [[]
  • - with -
  • ! with !

For example, the wildcardPattern [[]A]* will match any string beginning with [A]. Broken down, there is [[] which equates to an open square bracket [ followed by A]* as the closing square bracket is not a special character.

The three bracketed forms can be combined to create more complex character classes, for example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case)

glossary: character

Thank you for your feedback!

Was this page helpful?